hostgetkey store token before save in db and return#748
Open
kbats183 wants to merge 1 commit intoFOGProject:dev-branchfrom
Open
hostgetkey store token before save in db and return#748kbats183 wants to merge 1 commit intoFOGProject:dev-branchfrom
kbats183 wants to merge 1 commit intoFOGProject:dev-branchfrom
Conversation
Member
|
What is your use case for pulling tasks via the php file vs using the api?
…________________________________
JJ Fullmer
Senior IT Systems Engineer
[Arrowhead Dental Laboratory]
Email ***@***.******@***.***>
Phone (801) 572-7253<tel:+1(801)%20572-7253>
Web arrowheaddental.com<https://www.arrowheaddental.com/>
________________________________
[Facebook] <https://www.facebook.com/ArrowheadDentalLab> [Instagram] <https://www.instagram.com/arrowheaddentallab/> [YouTube]
CONFIDENTIALITY NOTICE:
This e-mail, including any attachments, may contain confidential information which is intended only for the use of the individual(s) or entities named.
If you receive this e-mail message in error, please immediately notify the sender by e-mail and delete it.
Dissemination, forwarding, printing or copying of this e-mail without prior consent of the sender is strictly prohibited.
________________________________
From: Konstantin Bats ***@***.***>
Sent: Monday, October 6, 2025 3:37:57 PM
To: FOGProject/fogproject ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [External][FOGProject/fogproject] hostgetkey store token before save in db and return (PR #748)
I encountered an issue when trying to pull tasks using fog/service/hostinfo.php.
In some cases, fog/status/hostgetkey.php generates a new token, saves it to the database, but returns an empty string as the token value.
I believe this happens due to a race condition between storing the token in the database and retrieving it for returning.
This change generates the new token before updating the database and reuses it for both the DB update and the return value.
This ensures the function always returns the correct token.
________________________________
You can view, comment on, or merge this pull request online at:
#748
Commit Summary
* 06477ff<06477ff> hostgetkey store token before save in db and return
File Changes
(1 file<https://github.com/FOGProject/fogproject/pull/748/files>)
* M packages/web/status/hostgetkey.php<https://github.com/FOGProject/fogproject/pull/748/files#diff-21c4a429533edde44e3af0159f8e7bfc0b653e13bcdbddffc880429ac8be712c> (5)
Patch Links:
* https://github.com/FOGProject/fogproject/pull/748.patch
* https://github.com/FOGProject/fogproject/pull/748.diff
—
Reply to this email directly, view it on GitHub<#748>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB3CO3E6JZADYNBL7Q7ILTD3WLOLLAVCNFSM6AAAAACIOMKK5SVHI2DSMVQWIX3LMV43ASLTON2WKOZTGQ4DSMRQHAZTSMA>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Author
|
I’m pulling tasks via the PHP file using the same approach that FOG uses to get kernel argument properties during USB boot. My use case is that I have more than 100 laptops that I want to image via FOG multicast only once (without continuous management through FOG afterward). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I encountered an issue when trying to pull tasks using
fog/service/hostinfo.php.In some cases,
fog/status/hostgetkey.phpgenerates a new token, saves it to the database, but returns an empty string as the token value.I believe this happens due to a race condition between storing the token in the database and retrieving it for returning.
This change generates the new token before updating the database and reuses it for both the DB update and the return value.
This ensures the function always returns the correct token.